<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>hash模式html原理</title>
</head>
<body>
<script defer>
    console.log(/iPhone|Android|webOS|BlackBerry/.test(navigator.userAgent))
    setTimeout(()=>{
        window.location.hash = '#abc'
        console.log(window.location.hash)
        window.addEventListener('hashchange', () =>{
            console.log(window.location.hash)
        })

        console.log(window.history)
    })
    window.addEventListener('click',()=>{
        console.log('click')
        // window.history.go(0) 用来刷新页面
        // window.history.go(1)// 相当于window.history.forward())
        // window.history.go(-1) // 相当于window.history.back()
        // window.history.go(0) // refresh
        // 这个方法有三个参数, object, 传递的参数， title 传递的标题， url 跳转的网址
        // window.history.pushState(1,null,'http://localhost:63342/Leetcode/Html5%E5%9F%BA%E7%A1%80/%E5%89%8D%E7%AB%AF%E8%B7%AF%E7%94%B1/hash%E6%A8%A1%E5%BC%8F%E5%8E%9F%E7%90%86/hashv2.html')
    })
</script>
</body>
</html>
